<meta charset="UTF-8">
<?php
$cars = array("baoma","wad","aodi");
echo $cars{1};
$cars{2} = "audi";//修改元素值

echo"<pre>";   
print_r($cars);//调试数组
echo count($cars);//计算机数组的个数

echo "<hr/>";
echo "foreach<br/> ";
foreach ($cars as $value) {
    echo $value."<br/>";
}
echo "<hr/>";
echo "for<br/> ";
$len = count($cars);
for ($i = 0; $i < $len; $i++)   {
    
    echo $cars[$i].  "<br/>";
}

  $grades = array("优秀","良好","中等","及格","不及格");
  $gradess = array("一","二","三","四","五","六","七","八","九","十","十一","十二");

  
  $message = array(
      "pic" => '<img src="images/3.jpg" alt="" />',
      "name" => "avatar",
      "content" =>  '天天好心情11111    <span> (来自火星"女侠"的留言)</span>',
      "sex" => 'male'
  );
  foreach ($message as $key => $value){
      echo  $key."=>". $value. "<br/>"
  ;} 
  ?>
<form>
    
    <select name="grade">
        <?php        foreach ($grades as $value):?>
        <option value="<?php echo $value; ?>" ><?php echo $value; ?></option> 
    <?php endforeach;?>
    </select>
    
</form>


<form>
    
    <select name="gradess">
        <?php        foreach ($gradess as $value):?>
        <option value="<?php echo $value; ?>" ><?php echo $value; ?></option> 
    <?php endforeach;?>
    </select>
    
</form>
